// Packet.h
//
// A datagram from one part of the system to another.
//

#ifndef __PACKET_H__
#define __PACKET_H__

#include "base/Entity.h"
#include "base/simtypes.h"
#include "util/Pool.h"

class Packet {
  public:
    NEW_DELETE_OPERATORS_H(Packet,NoSuper);
    Packet (Entity* src, Entity* dest);
    Packet (Entity* src, Entity* dest, uint size);
    virtual ~Packet ();

    Entity* getSource () const { return source; }
    Entity* getDestination () const { return destination; }

    uint    getSize () const { return size; }
    void    setSize (uint s) { size = s; }

    void    setSource (Entity* e) { source = e; }
    void    setDestination (Entity* e) { destination = e; }

    void    swap ();

    virtual char const* toString () const;

  protected:
    Entity* source; 
    Entity* destination;
    uint    size;

    char    string[512];
};

#endif // __PACKET_H__
